<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="/js/layui/css/layui.css">
    <script type="text/javascript" src="/js/jquery-3.2.1.js"></script>
    <link  href="/css/css/style.css" rel="stylesheet" media="screen">
    <style type="text/css">
        .container{
            width: 420px;
            height: 320px;
            min-height: 320px;
            max-height: 320px;
            position: absolute;
            top: 0;
            left: 0;
            bottom: 0;
            right: 0;
            margin: auto;
            padding: 20px;
            z-index: 130;
            border-radius: 8px;
            background-color: #fff;
            box-shadow: 0 3px 18px rgba(100, 0, 0, .5);
            font-size: 16px;
        }
        .close{
            background-color: white;
            border: none;
            font-size: 18px;
            margin-left: 410px;
            margin-top: -10px;
        }
        .layui-input{
            border-radius: 5px;
            width: 300px;
            height: 40px;
            font-size: 15px;
        }
        .layui-form-item{
            margin-left: -20px;
        }
        #logoid{
            margin-top: -16px;
            padding-left:150px;
            padding-bottom: 15px;
        }
        .layui-btn{
            border-radius: 5px;
            width: 120px;
            height: 40px;
            font-size: 15px;
        }
        .verity{
            width: 120px;
        }
        .font-set{
            font-size: 13px;
            text-decoration: none;
            margin-left: 120px;
        }
        a:hover{
            text-decoration: underline;
        }
    </style>
</head>
<body>
<div id="particles-js">
<form class="layui-form"  id="form1" lay-filter="login">
    <div class="container">
        <!--<button class="close" title="关闭">X</button>-->
        <div class="layui-form-mid layui-word-aux">
            <img id="logoid" src="/img/logo.jpg" height="35">
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">用户名</label>
            <div class="layui-input-block">
                <input type="text" name="account" required  lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">密 &nbsp;&nbsp;码</label>
            <div class="layui-input-inline">
                <input type="password" name="password" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">验证码</label>
            <div class="login-center-input">
                <input type="text" name="code" placeholder="验证码" required lay-verify="required" style="width: 120px"/>
                <img id="checkCode" alt="验证码" src="/checkCode" style="width: 70px;margin-left: 20px">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="loginBtnFilter">登录</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
        <!-- <a href="" class="font-set">忘记密码?</a><a href="" class="font-set">立即注册</a> -->
    </div>
</form>
</div>
<div style="text-align:center;">
</div>
</body>
<script type="text/javascript" src="/js/layui/layui.js"></script>
<!--登录页调整星空粒子间隔,坐标...-->
<script src="../js/particles.min.js"></script>
<script src="../js/app.js"></script>
<script>
    layui.use(['form','layer','jquery'], function(){
        var form = layui.form,
            $ = layui.jquery,
            layer = layui.layer;
        form.on('submit(loginBtnFilter)', function(d){
            var data1 = form.val("login");
            $.post('/master/cslogin',data1,function (rs) {
                if(rs.type=='success'){
                    location.href='/csIndex';
                }else{
                    //登陆失败提示信息
                    layer.msg(rs.msg);
                    $("#checkCode").click();
                    $("input[name='checkCode']").val("");//清空之前输入框的数据
                }
            },"json");
            return false;
        });

        $("#checkCode").click(function () {
            $(this).attr("src","/checkCode?"+new Date());
        });
    });
</script>
</html>